package com.yhsoft.buyer.mapper;

import com.yhsoft.buyer.controller.request.VenderOrdersInVo;
import com.yhsoft.buyer.controller.response.VenderOrdersOutVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderReportMapper {

    @Select("SELECT a.order_id AS OrderNo, a.order_id AS VenderOrderNo, b.name, b.mobile, a.order_status, c.goods_name\n" +
            "FROM buyer_order a\n" +
            "LEFT JOIN buyer_address b ON a.order_id = b.order_id\n" +
            "LEFT JOIN g_goods_info c ON a.order_id = c.vendor_id\n" +
            "WHERE c.vendor_id = #{vendorId}")
    List<VenderOrdersInVo> selectByVendorId(Class<VenderOrdersInVo> venderOrdersInVoClass, Integer vendorId);




    @Select("select a.order_id as OrderNo,b.order_id as OrderNo,b.name,c.goods_name,c.goods_type ,d.sku_name as SkuName,\n" +
            "       d.sku_quantity,b.name,b.mobile as Mobile,a.express_company as ExpressCompany,a.express_no as ExpressNo\n" +
            "from buyer_order a\n" +
            "    left join buyer_address b  on a.order_id=b.order_id\n" +
            "    left join g_goods_info c on a.order_id= c.id\n" +
            "    left join buyer_cart_sku d on a.order_id=d.goods_id")
    List<VenderOrdersOutVo> selectAu(Class<VenderOrdersOutVo> venderOrdersOutVoClass, Integer companyId);
}
